<?php

// WebPrint Functions file

// IMPORTANT...READ THIS!
// It is STRONGLY disrecommended that you edit this file if you don't know
// what you're doing. If there is one wrong character in this file, your whole
// site is likely to go kaputt. Proceed with extreme caution.

// Stuff that WordPress makes us have
add_theme_support('automatic-feed-links');

// Register our custom image sizes with WordPress

// Set up our menus
register_nav_menu('headernav', 'Header Navigation');
register_nav_menu('footernav', 'Footer Navigation');

// Set up our sidebar
$sidebar_args = array(
	'name' => __( 'Sidebar', 'webprint' ),
	'before_widget' => '<li id="%1$s" class="widget %2$s">',
	'after_widget' => '</li>',
	'before_title' => '<h2 class="widgettitle">',
	'after_title' => '</h2>'
);
register_sidebar($sidebar_args);

// Determines and returns the <title> attribute
function wbp_title() {
	// Set up some variables we'll be using
	$site_title = get_bloginfo('name');
	$site_description = get_bloginfo('description');
	$error_text = __('Page Not Found', 'webprint');
	$display_title = wp_title('', false);
	$search_query = get_search_query();
	// If we're looking at the homepage, return site title and description
	if(is_front_page()) {
		echo ''.$site_title.' | '.$site_description.'';
	}
	elseif(is_404()) {
		echo ''.$site_title.' | '.$error_text.'';
	}
	elseif(is_search()) {
		echo ''.$site_title.' | Search results for '.$search_query.'';
	}
	else {
		echo ''.$site_title.' | '.$display_title.'';
	}
}

// Function to develop the category loop for the homepage

// Homepage loop
function wbp_homepage_loop() { ?>
	<div id="homepage">
		<div id="home-main-stories">

		</div>
		<div id="home-other-stories">

		</div>
	</div>
<?php }

// Category page loop
function wbp_category_loop() {

}

// Static page loop
function wbp_page_loop() {

}

// Search page loop
function wbp_search_loop() {

}